<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <link rel="stylesheet" href="http://127.0.0.1:9999/qinyoudao/static/css/free_course.css">
    <script src="http://127.0.0.1:9999/qinyoudao/static/js/jquery-3.6.3.min.js"></script>
    
</head>
<body>
    <div id="head_line">
        <img src="http://127.0.0.1:9999/qinyoudao/static/images/logo.jpg" id="log"></img>
        <a href="http://127.0.0.1:9999/qinyoudao/templates/index.html">首页</a>
        <a href="http://127.0.0.1:9999/qinyoudao/templates/free_first.html">免费课</a>
        <a href="">直播课</a>
        <a href="http://127.0.0.1:9999/qinyoudao/templates/pay_first.html">精品课</a>
        <a href="http://127.0.0.1:9999/qinyoudao/templates/course.html">我的课程</a>
        <a href="">在线客服</a>
        <a id="search">
            <input type="text" name="yzm" placeholder="搜索课程">
            <button type="btn">搜索</button>
        </a>
        <a href=""></a>
        <a href="http://127.0.0.1:9999/qinyoudao/templates/login.html">个人中心</a>
    </div>
    <div id="head_mid_title">
        <span id="mid_">免费课</span>
        <span id="mid__">实现从0到1的完美蜕变，专业技术傍身成就职场高手</span>
    </div>
    <ul>
        <li class="li_free">
            <a href="http://127.0.0.1:9999/qinyoudao/templates/free_detail.html?v=v1">
                <img class="img" src="http://127.0.0.1:9999/qinyoudao/static/images/v1.jpg" alt="">
            </a>
            <a href="http://127.0.0.1:9999/qinyoudao/templates/free_detail.html?v=v1">
                <span class="course_title" id="v1"></span>
            </a>
            <span class="free">免费</span>
            <span class="enroll" id="v1y"></span>
        </li>

        <li class="li_free">
            <a href="http://127.0.0.1:9999/qinyoudao/templates/free_detail.html?v=v2">
                <img class="img" src="http://127.0.0.1:9999/qinyoudao/static/images/v2.jpg" alt="">
            </a>
            <a href="http://127.0.0.1:9999/qinyoudao/templates/free_detail.html?v=v2">
                <span class="course_title" id="v2"></span>
            </a>
            <span class="free">免费</span>
            <span class="enroll" id="v2y"></span>
        </li>

        <li class="li_free">
            <a href="http://127.0.0.1:9999/qinyoudao/templates/free_detail.html?v=v3">
                <img class="img" src="http://127.0.0.1:9999/qinyoudao/static/images/v3.jpg" alt="">
            </a>
            <a href="http://127.0.0.1:9999/qinyoudao/templates/free_detail.html?v=v3">
                <span class="course_title" id="v3"></span>
            </a>
            <span class="free">免费</span>
            <span class="enroll" id="v3y"></span>
        </li>

        <li class="li_free">
            <a href="http://127.0.0.1:9999/qinyoudao/templates/free_detail.html?v=v4">
                <img class="img" src="http://127.0.0.1:9999/qinyoudao/static/images/v4.jpg" alt="">
            </a>
            <a href="http://127.0.0.1:9999/qinyoudao/templates/free_detail.html?v=v4">
                <span class="course_title" id="v4"></span>
            </a>
            <span class="free">免费</span>
            <span class="enroll" id="v4y"></span>
        </li>

        <li class="li_free">
            <a href="http://127.0.0.1:9999/qinyoudao/templates/free_detail.html?v=v5">
                <img class="img" src="http://127.0.0.1:9999/qinyoudao/static/images/v5.jpg" alt="">
            </a>
            <a href="http://127.0.0.1:9999/qinyoudao/templates/free_detail.html?v=v5">
                <span class="course_title" id="v5"></span>
            </a>
            <span class="free">免费</span>
            <span class="enroll" id="v5y"></span>
        </li>
    </ul>
    <ul>
        <li class="li_free">
            <a href="http://127.0.0.1:9999/qinyoudao/templates/free_detail.html?v=v6">
                <img class="img" src="http://127.0.0.1:9999/qinyoudao/static/images/v6.png" alt="">
            </a>
            <a href="http://127.0.0.1:9999/qinyoudao/templates/free_detail.html?v=v6">
                <span class="course_title" id="v6"></span>
            </a>
            <span class="free">免费</span>
            <span class="enroll" id="v6y"></span>
        </li>

        <li class="li_free">
            <a href="http://127.0.0.1:9999/qinyoudao/templates/free_detail.html?v=v7">
                <img class="img" src="http://127.0.0.1:9999/qinyoudao/static/images/v7.png" alt="">
            </a>
            <a href="http://127.0.0.1:9999/qinyoudao/templates/free_detail.html?v=v7">
                <span class="course_title" id="v7"></span>
            </a>
            <span class="free">免费</span>
            <span class="enroll" id="v7y"></span>

        </li>

        <li class="li_free">
            <a href="http://127.0.0.1:9999/qinyoudao/templates/free_detail.html?v=v8">
                <img class="img" src="http://127.0.0.1:9999/qinyoudao/static/images/v8.png" alt="">
            </a>
            <a href="http://127.0.0.1:9999/qinyoudao/templates/free_detail.html?v=v8">
                <span class="course_title" id="v8"></span>
            </a>
            <span class="free">免费</span>
            <span class="enroll" id="v8y"></span>

        </li>

        <li class="li_free">
            <a href="http://127.0.0.1:9999/qinyoudao/templates/free_detail.html?v=v9">
                <img class="img" src="http://127.0.0.1:9999/qinyoudao/static/images/v9.png" alt="">
            </a>
            <a href="http://127.0.0.1:9999/qinyoudao/templates/free_detail.html?v=v9">
                <span class="course_title" id="v9"></span>
            </a>
            <span class="free">免费</span>
            <span class="enroll" id="v9y"></span>

        </li>

        <li class="li_free">
            <a href="http://127.0.0.1:9999/qinyoudao/templates/free_detail.html?v=v10">
                <img class="img" src="http://127.0.0.1:9999/qinyoudao/static/images/v10.jpg" alt="">
            </a>
            <a href="http://127.0.0.1:9999/qinyoudao/templates/free_detail.html?v=v10">
                <span class="course_title" id="v10"></span>
            </a>
            <span class="free">免费</span>
            <span class="enroll" id="v10y"></span>

        </li>
    </ul>
    <ul>
        <li class="li_free">
            <a href="http://127.0.0.1:9999/qinyoudao/templates/free_detail.html?v=v11">
                <img class="img" src="http://127.0.0.1:9999/qinyoudao/static/images/v11.jpg" alt="">
            </a>
            <a href="http://127.0.0.1:9999/qinyoudao/templates/free_detail.html?v=v11">
                <span class="course_title" id="v11"></span>
            </a>
            <span class="free">免费</span>
            <span class="enroll" id="v11y"></span>

        </li>

        <li class="li_free">
            <a href="http://127.0.0.1:9999/qinyoudao/templates/free_detail.html?v=v12">
                <img class="img" src="http://127.0.0.1:9999/qinyoudao/static/images/v12.jpg" alt="">
            </a>
            <a href="http://127.0.0.1:9999/qinyoudao/templates/free_detail.html?v=v12">
                <span class="course_title" id="v12"></span>
            </a>
            <span class="free">免费</span>
            <span class="enroll" id="v12y"></span>

        </li>

        <li class="li_free">
            <a href="http://127.0.0.1:9999/qinyoudao/templates/free_detail.html?v=v13">
                <img class="img" src="http://127.0.0.1:9999/qinyoudao/static/images/v13.png" alt="">
            </a>
            <a href="http://127.0.0.1:9999/qinyoudao/templates/free_detail.html?v=v13">
                <span class="course_title" id="v13"></span>
            </a>
            <span class="free">免费</span>
            <span class="enroll" id="v13y"></span>

        </li>

        <li class="li_free">
            <a href="http://127.0.0.1:9999/qinyoudao/templates/free_detail.html?v=v14">
                <img class="img" src="http://127.0.0.1:9999/qinyoudao/static/images/v14.jpg" alt="">
            </a>
            <a href="http://127.0.0.1:9999/qinyoudao/templates/free_detail.html?v=v14">
                <span class="course_title" id="v14"></span>
            </a>
            <span class="free">免费</span>
            <span class="enroll" id="v14y"></span>

        </li>

        <li class="li_free">
            <a href="http://127.0.0.1:9999/qinyoudao/templates/free_detail.html?v=v15">
                <img class="img" src="http://127.0.0.1:9999/qinyoudao/static/images/v15.jpg" alt="">
            </a>
            <a href="http://127.0.0.1:9999/qinyoudao/templates/free_detail.html?v=v15">
                <span class="course_title" id="v15"></span>
            </a>
            <span class="free">免费</span>
            <span class="enroll" id="v15y"></span>

        </li>
    </ul>



<script>
//打开网页就开始加载数据
    //获取网页头部地址
    var querystring = location
    var querystring1 = "http://127.0.0.1:8000/course/free_page"
    console.log(querystring1+"/data")
    window.onload=function(){
        $.ajax({
                url: querystring1+"/data",
                type: 'get',
                dataType: "json",
                success: function (res) {
                    
                    if (res.code == 200) {
                        res=res.data
                        var list_id=["v1", "v2", "v3", "v4", "v5", "v6",
               "v7", "v8", "v9", "v10", "v11", "v12",
               "v13", "v14", "v15"
               ]
               console.log(res)
               for(var i=0;i<16;i++){
                   var v=list_id[i]
                   var id2=v+"y"
                   $('#'+v).html(res[v])
                   $('#'+id2).html(res[id2])

               }
             }else{
                        alert(res.error)
                    }
                }
            })
    }
</script>
</body>
</html>